﻿-- http://forum.xbmc.org/showthread.php?tid=96097
-- Album thumbs are (usually) [album]+[artist] and are also stored in the database under the strThumb field.
-- Album/song thumbs may be taken from a folder.jpg image, and may be generated from the folder path or the song path. More info here on album/song thumbs.
-- Artist fanart is generated using the literal artist name, for example "Metallica" = b18ea041.
-- Artist thumbs are generated using "artist"+[artist name], for example Metallica = "artistmetallica" = 0a2d8dbc.

SELECT 100 AS DBObjectType, strThumb AS Filename
FROM thumb

UNION ALL

SELECT 103 AS DBObjectType, strArtist AS Filename
FROM artist

UNION ALL

SELECT 104 AS DBObjectType, CONCAT('artist', LOWER(strArtist)) AS Filename
FROM artist



/*
SELECT 101 AS DBObjectType, strPath AS Filename
FROM path

UNION ALL

SELECT 102 AS DBObjectType, CONCAT(AL.strAlbum, AR.strArtist) AS Filename
FROM album AL
INNER JOIN artist AR ON AR.idArtist = AL.idArtist

UNION ALL

SELECT 102 AS DBObjectType, CONCAT(S.strTitle, A.strArtist) AS Filename
FROM song S
INNER JOIN artist A ON A.idArtist = S.idArtist

UNION ALL

SELECT 102 AS DBObjectType, CONCAT(P.strPath, s.strTitle) AS Filename
FROM song S
INNER JOIN path P ON P.idPath = S.idPath
*/
